package com.example.controller;

import com.example.Mapper.userMapper;
import com.example.pojo.user;
import org.apache.tomcat.jni.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import org.springframework.web.bind.annotation.*;

@Controller
@CrossOrigin
public class userController {

    @Autowired
    private userMapper usermapper;
    @ResponseBody
    @GetMapping("/login")
    public int login(@RequestParam("username") String username,@RequestParam("password") String password){
        System.out.println(username+password);
        if (usermapper.login(username,password)==null){
            return 0;
        }else {
            return 1;
        }
    }

}
